package cn.bugstack.springframework.beans.factory.support;


import cn.bugstack.springframework.core.io.DefaultResourceLoader;
import cn.bugstack.springframework.core.io.ResourceLoader;

/**
 * @param
 * @author oyz
 * @version 1.0
 * @description: TODO Bean抽象类的实现
 * @date 2022/3/22 21:35
 */
public abstract  class AbstractBeanDefinitionReader implements BeanDefinitionReader {

    private final BeanDefinitionRegistry beanDefinitionRegistry;

    private ResourceLoader resourceLoader;

    protected AbstractBeanDefinitionReader(BeanDefinitionRegistry beanDefinitionRegistry) {
        this(beanDefinitionRegistry,new DefaultResourceLoader());

    }


    public AbstractBeanDefinitionReader(BeanDefinitionRegistry registry,ResourceLoader loader){
        this.beanDefinitionRegistry = registry;
        this.resourceLoader = loader;
    }


    @Override
    public BeanDefinitionRegistry getRegistry() {
        return beanDefinitionRegistry;
    }

    @Override
    public ResourceLoader getResourceLoader() {
        return resourceLoader;
    }


}
